#include <stdio.h>  
  
int main() {  
    char c;  
    double a, b, result;  
  
    printf("请输入两个操作数: ");  
    scanf("%lf %lf", &a, &b);  
    
    printf("请输入运算符 (+, -, *, /): ");  
    scanf(" %c", &c); // 注意%c前加空格以忽略之前的换行符  
    
    switch (c) {  
        case '+':  
            result = a + b;  
            printf("= %lf\n", result);  
            break;  
        case '-':  
            result = a - b;  
            printf("= %lf\n", result);  
            break;  
        case '*':  
            result = a * b;  
            printf("= %lf\n", result);  
            break;  
        case '/':   
            result = a / b;  
            printf("= %lf\n", result);  
            break;  
        default:  
            printf("重新输入\n");  
    }  
  
    return 0;  
}